package StudentsManage;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Student {
    public int id;
    public String name;
    public int age;
    public String address;

    public static ArrayList<Student> students = new ArrayList<>();

    //查询学号是否存在
    public static int getIndex(int id, ArrayList<Student> students){
        for (Student student : students) {
            if (student.id == id) {
                return id;
            }
        }
        return -1;
    }






}
